Component({
  properties: {
  },

  data: {
    todoList: []
  },


  attached() {
    const json = wx.getStorageSync('todoList')

    if (json) {
      this.setData({todoList: JSON.parse(json)})
    }
  },

  methods: {
    updateData(event) {
      const data = event.detail

      wx.setStorageSync('todoList', JSON.stringify(data.todoList))

      this.setData(data)
    },
  }
})